package lab02.Test11;

/**
 * Created by tanfei on 2017/10/25.
 */
public class Rectangle implements Printx {
    //属性：长、宽
    double length;
    double wideth;
    //行为：求面积、周长
    double premiter()
    {return((length*wideth)*2);}
    double area()
    {return(length*wideth);}
    @Override
    public void printMyWay() {
        System.out.println("长");
        System.out.println(length);
        System.out.println("宽");
        System.out.println(wideth);
        System.out.println("周长");
        System.out.println(premiter());
        System.out.println("面积");
        System.out.println(area());
    }
    public static void main(String[] args) {

    }
}


